
# CMakeList.txt:FYT2021 的 CMake 项目，在此处包括源代码并定义项目特定的逻辑。

cmake_minimum_required (VERSION 3.5)

project(FYT2021)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${CMAKE_SYSTEM_NAME}")

if (CMAKE_SYSTEM_NAME MATCHES "Windows")
    set(OpenCV_DIR D:/opencv/build)
    set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
    set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)
endif()



find_package(OpenCV 4.5 REQUIRED)
find_package(ngraph)
find_package(InferenceEngine)
find_package(CUDA)

include_directories(
    ${PROJECT_SOURCE_DIR}/Camera/Include
    /opt/intel/openvino_2021/inference_engine/include
 )

set(SRC
    "SerialPort/Protocol.cpp"
    "Camera/FightingDahengCapture.cpp"
    "Camera/FightingVideoCapture.cpp"
    "Camera/FightingUSBCapture.cpp"
    "Armor/ArmorDetector.cpp"
    "Rune/RuneDetector.cpp"
    "Config/CameraParam.cpp"
    "Config/ArmorParam.cpp"
    "Config/RuneParam.cpp"
    "Log/log.cpp"
    "Select/SelectDev.cpp"
    "Serial/SerialPort.cpp"
    "SolvePos/SolvePos.cpp"
    "Detector/Detector.cpp"
    "FYT2021.cpp"
)

add_executable (FYT2021 ${SRC})


    target_link_libraries( FYT2021 ${OpenCV_LIBS} -lpthread)
    target_link_libraries( FYT2021 "libgxiapi.so" )  


file(COPY "${PROJECT_SOURCE_DIR}/Config/CameraParam.yml" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/ArmorParam.yml" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/RuneParam.yml" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/svm.xml" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/knn_num.yml" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Template/" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/armor.names" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/armor_gpu.cfg" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/armor_gpu.weights" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/armor_cpu.cfg" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)
file(COPY "${PROJECT_SOURCE_DIR}/Config/armor_cpu.weights" DESTINATION ${EXECUTABLE_OUTPUT_PATH}/)

message("=======================================")
message("### # # ### # #  #  ###  #  ### ##  #")
message("#   # #  #  # #  #  #    #  # # # # #")
message("##  ###  #  # #  #  ###  #  # # # # #")
message("#    #   #   #   #    #  #  # # # # #")
message("#    #   #   #   #  ###  #  ### #  ##")
message("=======================================")

message("==================FYTVision Suggesstions=====================")
message("== 1. 当前代码的最近修改时间为2022年6月23日,详细修改内容请查看README.md")
# message("====== Recently modified on 2022/04/09")
message("== 2. 编译前请检查define.h中的宏是否按照要求改好，尤其是DEBUG和PC_DEBUG是否注释、运算设备是否选择正确")
# message("====== Please check 'define.h' file before compile, ESPECIALLY cancel macro DEBUG and PC_DEBUG, and select the correct device")
message("== 3. define.h 中，请从以下三个中选择一个运算设备")
# message("====== Please select one of the three devices below in file define.h")
message("==   -- MANIFOLD_G")
message("==   -- MANIFOLD_C")
message("==   -- NUC")
message("=============================================================")

